
#ifndef EYE_CUSTOM_TILING_H
#define EYE_CUSTOM_TILING_H
#include "register/tilingdata_base.h"
#include <cstdint>

struct EyeCustomTilingData : public TilingDataBase {
    uint32_t rowLength = 0;
    uint32_t columnLength = 0;
    int32_t  indexK = 0;
    uint32_t diagLen = 0;
    uint32_t fullTileLength = 0;
    uint32_t lastTileLength = 0;
    uint32_t alignNum = 0;
    uint32_t alignPadding = 0;
    uint32_t alignLength = 0;
    uint32_t typeSize = 4;
    uint32_t ubMax = 0;
    uint32_t loopCnt = 1;

    // 兼容旧代码字段
    uint32_t matrixNum = 1;
    uint32_t matrixOrder = 0;

    void SaveToBuffer(void *buf, size_t cap) const {
        size_t need = sizeof(EyeCustomTilingData);
        if (cap >= need) {
            *reinterpret_cast<EyeCustomTilingData*>(buf) = *this;
        }
    }
    size_t GetDataSize() const { return sizeof(EyeCustomTilingData); }
};

#define GET_TILING_DATA(varName, tilingGmAddr) \
    EyeCustomTilingData varName = *reinterpret_cast<const EyeCustomTilingData*>(tilingGmAddr);

#endif